Release 10.1A: OpenEdge Development:
Progress 4GL Reference
REPLACE function
Returns a string with specified substring replacements.
Syntax
source-stringSpecifies the base string to make replacements in. The
source-stringparameter can be any expression that evaluates to a string or a LONGCHAR. The REPLACE function does not change the value ofsource-stringitself; the function returns the string with replacements.from-stringSpecifies the substring to replace. The
from-stringparameter can be any expression that evaluates to a string or a LONGCHAR. Each occurrence offrom-stringwithinsource-stringis replaced.to-stringSpecifies the replacement substring. The
Exampleto-stringparameter can be any expression that evaluates to a string or a LONGCHAR. Each occurrence offrom-stringinsource-stringis replaced byto-string.The following example uses the REPLACE function to replace the string “user” with an actual user ID, if available:
Notes
- The REPLACE function replaces all occurrences of
from-stringwithinsource-string. After replacing a substring, the REPLACE function resumes searching the string after the inserted text. Thus, the inserted text is not recursively searched (in whole or in part) forfrom-string.- The search for occurrences of
from-stringwithinsource-stringis not case sensitive, unless one of the three values used in the function (source-string,to-string, orfrom-string) is a case-sensitive field or variable.See also
|
Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |